﻿<%@ Page Language="C#" MasterPageFile="~/Template.master" AutoEventWireup="true"
    CodeFile="NewInternalAccounting.aspx.cs" Inherits="NewInternalAccounting" Title="Ghasam | New Internal Accounting" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager ID="smInternalAccounting" runat="server" ScriptMode="Release">
    </asp:ScriptManager>

    <script language="javascript" type="text/javascript">
        function calculatePrice(q, u, a) {
            quantity = q.value;
            unitprice = u.value;            
            a.value = quantity * unitprice;
        }        
    
    </script>

    <div id="divNewInternalAccounting" runat="server">
        <div class="title">
            <span class="pageTitle">
                <asp:Label ID="lblTitle" runat="Server" Text="ثبت هزینه"></asp:Label>
            </span>
        </div>
        <hr />
        <div style="margin: 30px 10px;">
            <div id="divType" runat="server">
                نوع پرداختی :
                <asp:DropDownList ID="ddlInternalAccountingType"
                    DataTextField="Description" DataValueField="Id" runat="server" />
            </div>
            <br />
            <asp:UpdatePanel ID="upItemsList" runat="server">
                <contenttemplate>
                    <div>
                        تعداد ردیف ها :
                        <asp:TextBox ID="txtCount" Width="40" runat="server" />
                        <asp:Button ID="btnGenerateRows" Text="نمایش" runat="server" OnClick="btnGenerateRows_Click" />
                    </div>
                    <br />
                    <table cellpadding="5" border="2" cellspacing="1" style="border-color: Blue" width="850">
                        <tr style="background: #eaeaea; text-align: center">
                            <td>
                                نام حساب
                            </td>
                            <td>
                                فروشنده
                            </td>
                            <td>
                                نام کالا
                            </td>
                            <td>
                                مقدار
                            </td>
                            <td>
                                قیمت واحد ( ریال )
                            </td>
                            <td>
                                قیمت کل ( ریال )
                            </td>
                            <td>
                                فوری
                            </td>
                        </tr>
                        <asp:PlaceHolder ID="phInternalAccountingRows" EnableViewState="true" runat="server">
                        </asp:PlaceHolder>
                    </table>
                    
                    </contenttemplate>
            </asp:UpdatePanel>
            <br />
            <br />
            <asp:Button ID="btnSave" Text="ثبت هزینه" ValidationGroup="Accounting" runat="server"
                OnClick="btnSave_Click" />
        </div>
        <br />
        <br />
        <hr />
        <br />
        <div class="title">
            <span class="pageTitle">
                <asp:Label ID="lblItemTitle" runat="Server" Text="اضافه کردن کالا"></asp:Label>
            </span>
        </div>
        <div>
            <asp:UpdatePanel ID="upItem" runat="server">
                <contenttemplate>
                    <asp:Label ID="lblMessage" ForeColor="Red" runat="server" />
                    <br />
                    <br />
                    نام کالا :
                    <asp:TextBox ID="txtItemName" runat="server" />
                    <asp:RequiredFieldValidator ID="rfvItemName" ValidationGroup="Items" ControlToValidate="txtItemName"
                        ErrorMessage="*" runat="server" />
                    <br />
                    <br />
                    واحد کالا :
                    <asp:TextBox ID="txtItemUnit" runat="server" />
                    <asp:RequiredFieldValidator ID="rfvItemUnit" ValidationGroup="Items" ControlToValidate="txtItemUnit"
                        ErrorMessage="*" runat="server" />
                    <br />
                    <br />
                    <asp:Button ID="btnSaveItem" Text="ذخیره" ValidationGroup="Items" runat="server"
                        OnClick="btnSaveItem_Click" />
                </contenttemplate>
                <triggers>
                    <asp:AsyncPostBackTrigger EventName="Click" ControlID="btnSaveItem" />
                </triggers>
            </asp:UpdatePanel>
        </div>
    </div>
</asp:Content>
